package com.example.myapplication4;

import android.app.Activity;

import java.lang.reflect.Field;
import java.lang.reflect.Method;

public class TestMain {


    public static void main(String[] args) {

        Class class1 = null;
        try {
            class1 = Class.forName("com.example.myapplication4.TestMethod");
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
        try {
            Method method = class1.getDeclaredMethod("getTestStr", String.class);
            System.out.println("打印信息：" + method.getName());
        } catch (NoSuchMethodException e) {
            e.printStackTrace();
        }

    }
}
